import style from './style.scss';
var $ = require('jquery');
require('jquery-ui');

export default class Resizable extends React.Component{
	constructor(){
		super();
		this.state = {};
	}
	// drag(){
	// 	console.log('呵呵')
	// }
	componentDidMount(){
		let $el = $(React.findDOMNode(this)).find('.'+style['resizable-container'])
		console.log($el)
		$el.resizable({
			maxHeight: 250,
      maxWidth: 350,
      minHeight: 150,
      minWidth: 200
		})
		
		// $(style['resizable']).resizable({
		// 	// containment: style["drag-zone"]
		// 	maxHeight: 250,
  //     maxWidth: 350,
  //     minHeight: 150,
  //     minWidth: 200
		// });
	}

	render(){
		let dragZone = this.props.dragZone?this.props.dragZone:(<div></div>)
		return (
			<div className={style["resizable"]}>
				<div className={style["resizable-container"]}>
					{this.props.children}
				</div>
			</div>
		)
	}
}